﻿CREATE TABLE [dbo].[HospSetting]
(
	[Id] INT NOT NULL PRIMARY KEY IDENTITY, 
    [HospId] INT NOT NULL, 
	[DeptId] INT NULL, 
    [DrId] INT NULL,
    [Key] NVARCHAR(50) NOT NULL, 
    [Value] NVARCHAR(500) NULL, 
	[RecStatus] INT NOT NULL, 
    [RecCreateDt] DATETIME NOT NULL, 
    [RecUpdateDt] DATETIME NULL, 
    [RecDeleteDt] DATETIME NULL
    
)

GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'医院设置表',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospSetting',
    @level2type = NULL,
    @level2name = NULL
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'主键，自增长',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospSetting',
    @level2type = N'COLUMN',
    @level2name = N'Id'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'医院Id',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospSetting',
    @level2type = N'COLUMN',
    @level2name = N'HospId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'所属键名称',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospSetting',
    @level2type = N'COLUMN',
    @level2name = N'Key'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'值,如是复合枚举类型的话，各个枚举值的分割符为:||:',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospSetting',
    @level2type = N'COLUMN',
    @level2name = N'Value'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'科室Id',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospSetting',
    @level2type = N'COLUMN',
    @level2name = N'DeptId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'医生Id',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospSetting',
    @level2type = N'COLUMN',
    @level2name = N'DrId'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'记录状态, 1：正常；2：删除',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospSetting',
    @level2type = N'COLUMN',
    @level2name = N'RecStatus'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'记录创建时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospSetting',
    @level2type = N'COLUMN',
    @level2name = N'RecCreateDt'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'记录上次修改时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospSetting',
    @level2type = N'COLUMN',
    @level2name = N'RecUpdateDt'
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'记录删除时间',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'HospSetting',
    @level2type = N'COLUMN',
    @level2name = N'RecDeleteDt'